package com.fanjia.rabbitmq_consumer.topic;

import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.stereotype.Service;

/**
 * @author fanjia
 * @className FanoutDuanxinConsumer
 * @description TODO
 * @date 2021/4/18 10:28
 */
@RabbitListener(bindings = @QueueBinding(
        value = @Queue(value = "sms.topic.queue",durable = "true",autoDelete = "false"),
        exchange = @Exchange(value = "topic_order_exchange",type = ExchangeTypes.TOPIC),
        key = "#.sms.#"
))
@Service
public class TopicSMSConsumer {

    @RabbitHandler
    public void receiveMessage(String message){
        System.out.println("sms topic -->接收到的订单信息： -》 "+message);
    }
}
